
package org.darcy.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.darcy.entity.BizArticle;
import org.darcy.entity.BizTags;
import org.darcy.entity.BizType;
import org.darcy.framework.model.PageParam;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@ApiModel("文章: BizArticleModel")
@Getter
@Setter
public class BizArticleModel extends PageParam implements Serializable{
	
	private static final long serialVersionUID = 1L;
     
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value="")
	private Long id;
	
    @ApiModelProperty(value="文章标题")
	private String title;
	
    @ApiModelProperty(value="用户ID")
	private Long userId;
	
    @ApiModelProperty(value="文章封面图片")
	private String coverImage;
	
    @ApiModelProperty(value="当前文章适用的编辑器类型")
	private String editorType;
	
    @ApiModelProperty(value="文章专属二维码地址")
	private String qrcodePath;
	
    @ApiModelProperty(value="")
	private Boolean isMarkdown;
	
    @ApiModelProperty(value="文章内容")
	private String content;
	
    @ApiModelProperty(value="markdown版的文章内容")
	private String contentMd;
	
    @ApiModelProperty(value="是否置顶")
	private Boolean top;
	
    @ApiModelProperty(value="类型")
	private Long typeId;
	
    @ApiModelProperty(value="状态")
	private Byte status;
	
    @ApiModelProperty(value="是否推荐")
	private Boolean recommended;
	
    @ApiModelProperty(value="是否原创")
	private Boolean original;
	
    @ApiModelProperty(value="文章简介，最多200字")
	private String description;
	
    @ApiModelProperty(value="文章关键字，优化搜索")
	private String keywords;
	
    @ApiModelProperty(value="是否开启评论")
	private Boolean comment;
	
    @ApiModelProperty(value="文章私密访问时的密钥")
	private String password;
	
    @ApiModelProperty(value="该文章是否登录后才可访问")
	private Boolean requiredAuth;
	
    @ApiModelProperty(value="添加时间")
	private Date createTime;
	
    @ApiModelProperty(value="更新时间")
	private Date updateTime;
	
    
    /**
   	 * model类转化为mybatis plus 查询条件
   	 */
   	public QueryWrapper<BizArticle> buildWrapper() {
   		QueryWrapper<BizArticle> p = new QueryWrapper<BizArticle>();
   		return p;
   	}
   	
   	@ApiModelProperty(value="标签")
   	private List<BizTags> tags;

   	@ApiModelProperty(value="分类")
	private BizType bizType;
	
   	@ApiModelProperty(value="浏览次数")
	private Integer lookCount;
	
   	@ApiModelProperty(value="评论次数")
	private Integer commentCount;
	
   	@ApiModelProperty(value="收藏次数")
	private Integer loveCount;
	
   	@ApiModelProperty(value="主标签")
	private Long tagId;

   	@ApiModelProperty(value="是否随机排序")
	private Boolean random;
	
   	@ApiModelProperty(value="标签")
	private List<Long> tagIds;


}
